//
//  KLBookAuthor.m
//  KLBookStore
//
//  Created by apple on 2017/10/15.
//  Copyright © 2017年 NetEaseExam. All rights reserved.
//

#import "KLBookAuthor.h"

@implementation KLBookAuthor

- (instancetype)initWithDictionary:(NSDictionary *)dict {
    KLBookAuthor *author = [[[self class] alloc] init];
    author.bookId = [[dict objectForKey:@"bookId"] longLongValue];
    author.name = [dict objectForKey:@"name"];
    return author;
}

- (instancetype)initWithFMResultSet:(FMResultSet *)resultSet {
    KLBookAuthor *bookAuthors = [[[self class] alloc] init];
    
    bookAuthors.bookId = [resultSet longLongIntForColumn:@"bookId"];
    bookAuthors.name = [resultSet stringForColumn:@"name"];
    
    return bookAuthors;
}

- (id)copyWithZone:(NSZone *)zone {
    KLBookAuthor *author = [[[self class] allocWithZone:zone] init];
    author.bookId = self.bookId;
    author.name = [self.name copy];
    
    return author;
}

@end
